package com.seeyoui.kensite.framework.file.service.impl;

import org.springframework.stereotype.Service;
import org.springframework.ui.Model;

import com.seeyoui.kensite.framework.file.model.FileAttribute;
import com.seeyoui.kensite.framework.file.service.FilePreview;
import com.seeyoui.kensite.framework.file.utils.FileUtils;
import com.sun.star.uno.Exception;

/**
 * Created by kl on 2018/1/17.
 * Content :处理pdf文件
 */
@Service
public class PdfFilePreviewImpl implements FilePreview{

    @Override
    public String[] filePreviewHandle(String url, Model model) {
        FileAttribute fileAttribute = null;
        try {
            fileAttribute = FileUtils.getFileAttribute(url);
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return new String[]{"pdf","demo/"+fileAttribute.getName()};
    }
}
